import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

class DAppTagItem extends StatelessWidget {
  DAppTagItem({super.key, required this.title, required this.onClick, this.isActive = false});

  String title;
  Function onClick;
  bool isActive = false;

  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return Container(
      margin: EdgeInsets.only(right: 10.w),
      child: InkWell(
        onTap: () {
          onClick();
        },
        child: Container(
          padding: EdgeInsets.only(top: 0, right: 12.w, bottom: 0, left: 12.w),
          decoration: BoxDecoration(
            borderRadius: BorderRadius.circular(8.w),
            color: isActive ? const Color.fromRGBO(134, 103, 254, 1) : const Color.fromRGBO(246, 246, 246, 1),
          ),
          child: Align(
            alignment: Alignment.center,
            child: Text(
              title,
              style: TextStyle(
                color: isActive ? const Color.fromRGBO(255, 255, 255, 1) : const Color.fromRGBO(134, 131, 145, 1),
                fontSize: 12.sp,
                fontWeight: FontWeight.w400,
              ),
            ),
          ),
        ),
      ),
    );
  }
}
